package shark.flow.config;

import org.flowable.idm.spring.SpringIdmEngineConfiguration;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.spring.boot.EngineConfigurationConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import shark.flow.identity.SharkUserEntityManager;

@Configuration
public class FlowConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration>{
    @Bean
    public EngineConfigurationConfigurer<SpringIdmEngineConfiguration> MyIdmEngineConfigurer() {
        return idmEngineConfiguration -> idmEngineConfiguration
                .setIdmIdentityService(new SharkUserEntityManager(idmEngineConfiguration));
    }

    @Override
    public void configure(SpringProcessEngineConfiguration engineConfiguration) {
        engineConfiguration.setActivityFontName("宋体");
        engineConfiguration.setLabelFontName("宋体");
        engineConfiguration.setAnnotationFontName("宋体");
    }
}
